<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>员工列表页面</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/bootstrap-3.3.7-dist/css/bootstrap.min.css">
    <script src="${pageContext.request.contextPath}/js/jquery-2.2.4.js"></script>
    <script src="${pageContext.request.contextPath}/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
</head>
<body>
<jsp:include page="nav.jsp"/>

<div class="container">
    <%--轮播图


    <div id="carousel-example-generic" class="carousel slide panel" data-ride="carousel">
       <!-- Indicators -->
       <ol class="carousel-indicators">
         <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
         <li data-target="#carousel-example-generic" data-slide-to="1"></li>
         <li data-target="#carousel-example-generic" data-slide-to="2"></li>
       </ol>

       <!-- Wrapper for slides -->
       <div class="carousel-inner" role="listbox">
         <div class="item active">
           <img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1583731872584&di=b52487cd1cb2b544da990d80642ac1f9&imgtype=0&src=http%3A%2F%2Fstatic-news.17house.com%2Fweb%2Ftoutiao%2F201706%2F09%2F14969747461596393511.png" alt="...">
           <div class="carousel-caption">
             ...
           </div>
         </div>
         <div class="item">
           <img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1583731872584&di=b52487cd1cb2b544da990d80642ac1f9&imgtype=0&src=http%3A%2F%2Fstatic-news.17house.com%2Fweb%2Ftoutiao%2F201706%2F09%2F14969747461596393511.png" alt="...">
           <div class="carousel-caption">
             ...
           </div>
         </div>
       </div>

       <!-- Controls -->
       <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
         <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
         <span class="sr-only">Previous</span>
       </a>
       <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
         <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
         <span class="sr-only">Next</span>
       </a>
     </div>

--%>

    <div class="panel panel-default">
        <div class="panel-heading">员工列表</div>
        <div class="panel-body">
            <table class="table table-bordered">
                <thead>
                <tr>
                    <th>姓名</th>
                    <th>员工号</th>
                    <th>性别</th>
                    <th>月薪</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <c:forEach items="${pageInfo.list}" var="e">
                    <tr>
                        <td>${e.name}</td>
                        <td>${e.empNo}</td>
                        <td>
                            <c:if test="${e.sex}">男</c:if>
                            <c:if test="${!e.sex}">女</c:if>
                        </td>
                        <td>${e.sal}</td>
                      <td>
                          <a href="${pageContext.request.contextPath}/toUpdateEmp.do?id=${e.id}" class="btn btn-success btn-xs">更改</a>
                          <a href="${pageContext.request.contextPath}/delemp.do?id=${e.id}&pageNo=${pageInfo.pageNo}&pageSize=${pageInfo.pageSize}" class="btn btn-danger btn-xs">删除</a>
                      </td>
                    </tr>
                </c:forEach>
                <tr>
                    <td colspan="5" class="text-right">
                        <c:if test="${!pageInfo.first}">
                            <a href="${pageContext.request.contextPath}/listEmployee.do?pageNo=${pageInfo.prePage}&pageSize=${pageInfo.pageSize}"
                               class="btn btn-info btn-xs">上一页 </a>
                        </c:if>
                        ${pageInfo.pageNo}/${pageInfo.totalPage}
                        <c:if test="${!pageInfo.last}">
                            <a href="${pageContext.request.contextPath}/listEmployee.do?pageNo=${pageInfo.nextPage}&pageSize=${pageInfo.pageSize}"
                               class="btn btn-info btn-xs">下一页 </a>
                        </c:if>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>

</div>
</body>
</html>
